$(document).ready(function () {
    $('.post-body img').each(function () {
    $(this).css('visibility', 'hidden');
        var originalLink = $(this).parent('a').attr('href');
        if ($(this).attr('src') != originalLink) { $(this).attr('src', originalLink) }
        $(this).removeAttr('width');
        $(this).removeAttr('height');
        var parent = $(this).parents('.post.hentry');
        var topicLink = $('.post-title a', parent).attr('href');
      if(topicLink) {
        $(this).parent('a').attr(
            {
                'href': topicLink,
                'target': '_blank',
            });
        var postEntry = $(this).parents('.post.hentry');
        var commentButton = $('.post-footer .comment-button-link-to-post');
        if(commentButton){ 
              $(commentButton).show();
        }
    }
        $(this).css('visibility', 'visible');
    });
});